package wxusers

import (
	"gitee.com/bitwormhole/weixin-applet-backend/app/data/dxo"
	"gitee.com/bitwormhole/weixin-applet-backend/app/data/entity"
	"gorm.io/gorm"
)

// DAO ...
type DAO interface {
	Find(db *gorm.DB, id dxo.WeixinAppletUserID) (*entity.WeixinAppletUser, error)

	FindByOpenID(db *gorm.DB, openid string) (*entity.WeixinAppletUser, error)

	ContainOpenID(db *gorm.DB, openid string) (bool, error)

	Insert(db *gorm.DB, item *entity.WeixinAppletUser) (*entity.WeixinAppletUser, error)

	Update(db *gorm.DB, id dxo.WeixinAppletUserID, fn func(*entity.WeixinAppletUser)) (*entity.WeixinAppletUser, error)

	Delete(db *gorm.DB, id dxo.WeixinAppletUserID) error
}
